package com.czk.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;

import java.util.Date;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/8/27 16:38
 */
@Data
@ContentRowHeight(20) // 内容行高
@HeadRowHeight(30) // 表头行高
public class Student {
    @ExcelProperty(value = "学生姓名",index = 0) // 列名 index列排序
    @ColumnWidth(20) // 列宽度
    private String name;
    @ExcelProperty(value = "性别",index = 1)
    private String gender;
    @ExcelProperty(value = "生日",index = 2)
    @ColumnWidth(20)
    @DateTimeFormat("yyyy-MM-dd")
    private Date birthday;
    @ExcelProperty(value = "ID")
    @ExcelIgnore // 忽略，当前字段不参与读写
    private String id;
}
